source code between the #ifdef and the #else (if present) is compiled. Otherwise the source code between #else and #endif is compiled. The programmer places source code appropriate to only one circumstance following the #ifdef and code for the other circumstance following the #else. Thus, with only a single change ΓÇö incorporation of the appropriate #define directive ΓÇö source code appropriate to the chosen circumstance may be compiled.
For example, it may be desired that a program compile under two slightly different C compilers, having different names for the header file for standard string functions:
# define CCOMP1 /* remove this line for alternate compiler */